//
// Created by Administrator on 2021/10/14.
//

#include "Object3DInfoGui.h"

void Object3DInfoGui::render(Geometry * geometry) {
    ImVec2 size(200, 200);
    ImGui::SetWindowSize(size);

    ImGui::Begin("INFO");
    ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f),"%.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate,ImGui::GetIO().Framerate);
    ImGui::Text("Translation:");
    ImGui::SliderFloat("tx", &geometry->position->x, -1, 1);
    ImGui::SliderFloat("ty", &geometry->position->y, -1, 1);
    ImGui::SliderFloat("tz", &geometry->position->z, -1, 1);
    ImGui::Text("Rotation:");
    ImGui::SliderFloat("rx", &geometry->rotation->x, 0, 360);
    ImGui::SliderFloat("ry", &geometry->rotation->y, 0, 360);
    ImGui::SliderFloat("rz", &geometry->rotation->z, 0, 360);
    ImGui::Text("Scale:");
    ImGui::SliderFloat("sx", &geometry->scale->x, 0.05, 5);
    ImGui::SliderFloat("sy", &geometry->scale->y, 0.05, 5);
    ImGui::SliderFloat("sz", &geometry->scale->z, 0.05, 5);
    ImGui::End();
}

void Object3DInfoGui::render() {

}
